//
//  HZHybridWebView.h
//  app
//
//  Created by 刘华舟 on 15/5/19.
//  Copyright (c) 2015年 hdaren. All rights reserved.
//

#import <UIKit/UIKit.h>

// Needed for WKNavigationDelegate and WKUIDelegate
#import <WebKit/WebKit.h>
// Used to define the webView property below
#import "HZWebViewProvider.h"

@class HZHybridWebView;

@protocol HZHybridWebViewDelegate <NSObject>

@required

//确定是否应该允许导航
- (BOOL)hybrideWebView:(HZHybridWebView*)hybridWebView shouldStartDecidePolicy: (NSURLRequest *) request;

@optional

//完成开始加载
- (void)hybrideWebViewDidStartNavigation:(HZHybridWebView*)hybridWebView;
//加载失败
- (void)hybrideWebView:(HZHybridWebView*)hybridWebView failLoadOrNavigation: (NSURLRequest *) request withError: (NSError *) error;
//完成加载
- (void)hybrideWebView:(HZHybridWebView*)hybridWebView finishLoadOrNavigation: (NSURLRequest *) request;

@end

@interface HZHybridWebView : UIView

@property(nonatomic ,weak) id<HZHybridWebViewDelegate>delegate;

@property (weak, nonatomic) UIScrollView *scrollView;

// The main web view that is set up in the viewDidLoad method.
@property (nonatomic, strong) UIView <HZWebViewProvider> *webView;

//加载网页
- (void)loadRequestFromString:(NSString *)urlNameAsString;

@end
